package com.nnnu.wsnackshop.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;

@Data
@Schema(description = "添加商品SKU参数")
public class AddSkuDTO {
    @NotNull
    @Schema(description = "商品SPU ID")
    private Integer spuId;

    @NotNull
    @Schema(description = "商品ID，关联 products.id")
    private Integer productId;

    @NotBlank
    @Schema(description = "SKU标题")
    private String title;
    @Schema(description = "SKU编码")
    private String skuCode;
    @Schema(description = "SKU图片")
    private String images; // JSON 字符串
    @Schema(description = "SKU价格")
    @NotNull
    private BigDecimal price;
    @Schema(description = "SKU成本价")
    private BigDecimal costPrice;
    @Schema(description = "SKU规格组合")
    private String specCombination; // 如 "flavor:plain;weight:500"
    @Schema(description = "库存")
    @NotNull
    private Integer stock;
    @Schema(description = "上架状态，0：下架，1：上架")
    @NotNull
    private Boolean saleable;
    @Schema(description = "是否有效，0：无效，1：有效")
    private Boolean valid = true;
}
